<?php
    include ("./src/jpgraph.php");
    include ("./src/jpgraph_error.php");
    include ("./src/jpgraph_scatter.php");
    
    function _cb_negate($aVal) {
		return round(-$aVal);
	}
    
    $mygen=" 25224";
    $exploded_mygen=explode(',', $mygen);
    
    
    
    
		$targ1[0] = "http://www.fossilplot.org/test/graph/undercon.php?myarg=25224"; 	    
	    $alts1[0] = "Genus ID:25224   Name:Archimedes";
	    $scattery=array(-352);$datay=array(-352,-280);
	//for($i=0; $i <count($scattery); ++$i ) {
	//    $targ1[$i] = "http://www.fossilplot.org/test/graph/undercon.php"; 	    
	 //   $alts1[$i] = "genus=$exploded_mygen[$i]";
	    
	//	}
	
	
	    
    $graph = new Graph(600,400,"auto");    
	$graph->SetScale("textlin");

	$graph->img->SetMargin(40,30,20,80);
	$graph->SetShadow();
	
	$errplot=new ErrorPlot($datay);
	$errplot->SetColor("red");
	$errplot->SetWeight(2);
	$errplot->SetCenter();

	
	$graph->Add($errplot);
	
	
		$sp1 = new ScatterPlot($scattery,$datax);
		$sp1->SetCSIMTargets($targ1,$alts1);

		$graph->Add($sp1);
	

	$graph->title->Set("Individual Genera");
	$graph->xaxis->title->Set("Individual Genera");
	$graph->yaxis->title->Set("Time: M.Y.");

	$graph->title->SetFont(FF_FONT1,FS_BOLD);
	$graph->yaxis->SetLabelFormatCallback("_cb_negate");

	$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
	$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
	$graph->xaxis->Hide();
	//$graph->xaxis->SetTextLabelInterval(36339);
	$datax = $gDateLocale->GetShortMonth();
	$graph->xaxis->SetTickLabels($datax);
	//$graph->StrokeCSIM('auto');
	//$graph->Stroke('../../../admin1/list/graph/jpgraph_cache/rangegraph.png');
	$graph->Stroke('./jpgraph_cache/rangegraph.png');
	//$graph->Stroke('/var/www/fossilplot/test/graph/jpgraph_cache/rangegraph.png');
	$imgmap = $graph->GetHTMLImageMap('scattermap');
	echo $imgmap;
	//echo "<img src='http://www.fossilplot.org/test/graph/jpgraph_cache/rangegraph.png' ISMAP USEMAP='#scattermap' border='0'>";
	echo "<img src='http://www.fossilplot.org/test/graph/jpgraph_cache/rangegraph.png' ISMAP USEMAP='#scattermap' border='0'>";
	//echo "<img src='http://www.fossilplot.org/test/graph/jpgraph_cache/rangegraph.png' ISMAP USEMAP='#scattermap' border='0'>";
	
	
	
	?>